const router = require('express').Router()
const axios = require('axios')

router.get('/auth', async (req, res, next) => {
  const code = req.query.code
  const AppID = 'wxeb8c70d2f9b9d1d3'
  const AppSecret = 'c3705296c1853e24eea6767dbc567836'

  let result = await axios.get(`https://api.weixin.qq.com/sns/jscode2session?appid=${AppID}&secret=${AppSecret}&js_code=${code}&grant_type=authorization_code`)

  console.log(result)
})

module.exports = router